import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';

import '../model/result.dart';

BaseOptions baseOptions = BaseOptions(
  baseUrl: 'https://mock.presstime.cn',
  connectTimeout: const Duration(seconds: 5),
  receiveTimeout: const Duration(seconds: 15),
);
Dio dio = Dio(baseOptions);

Future<Result> post(String path) async {
  var response = await dio.post(path);
  debugPrint('$response');

  /// todo 判断结果
  return Result.fromJson(response.data);
}
